package com.lanjing.common.core.enums;

import lombok.Getter;

@Getter
public enum ResultEnum implements BaseEnum{

    SUCCESS(20000, "成功"),
    ERROR(50000, "失败"),
    INVALID_PAGE_OR_PAGE_SIZE(20003, "分页数据有错"),
    REQUEST_ILLEGAL(50003, "请求非法"),
    USER_IS_BAN_FOUND(50017, "该用户已禁用"),
    REPEATED_SECKILL(50003, "不能重复秒杀"),
    UNAUTHORIZED(50001, "认证失败"),
    UNPERMISSIONS(50027, "当前权限不足"),
    PASSWORD_ERROR(50002, "密码错误"),
    USER_NO_LOGIN(50002, "用户未登录"),
    OLD_PASSWORD_ERROR(50002, "旧密码有误"),
    USER_PASSWORD_VALID(50002, "账号密码错误"),
    TOKEN_PARSING_ERROR(50014, "token解析失败"),
    FORBIDDEN(50003, "没有权限"),
    RESOURCE_NOT_FOUND(50004, "资源未找到"),
    USER_NOT_FOUND(50004, "用户未找到"),
    MOBILE_NOT_EXIST(50004, "手机号不存在"),
    ROLE_NOT_FOUND(50004, "角色未曾找到"),
    ACCESS_LIMIT_REACHED(50029, "访问太频繁！"),
    REPEATED_REGISTER_MOBILE(50009, "手机号码已注册"),
    REPEATED_REGISTER_USERNAME(50009, "用户名已经被注册"),
    PERMISSION_EXIST_ERROR(50009, "已经存在"),
    PERMISSION_DELETES_ERROR(50009, "已被使用,请先取消关联"),
    SECKILL_OVER(50010, "商品已秒杀完毕"),
    GOODS_CREATE_FAIL(50000, "goods创建失败"),
    IMAGE_UPLOAD_FAIL(50000, "图片上传失败"),
    PERMISSION_CREATE_ERROR(50000, "创建失败"),
    PERMISSION_UPDATE_ERROR(50000, "修改失败"),
    SYSTEM_ERROR(50000, "系统异常");

    private final int code;
    private final String message;

    ResultEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public String toString() {
        return "ResultEnum{" +
                "code=" + code +
                ", message='" + message + '\'' +
                '}';
    }
}
